Ext.define('ES.view.uploadComp.UploadComp',{
	extend:'Ext.window.Window',
	requires:['Ext.window.Window','Ext.form.Panel','Ext.form.field.ComboBox','Ext.form.field.File','Ext.ux.form.MultiSelect','ES.store.upload.UploadStore'],
	alias:'widget.uploadcomp',
	title:'Upload your component',
	width:750,
	modal:true,
	layout:{
		type:'fit'
	},
	config:{
		catStore:{},
		subCatStore:{}
	},
	initComponent:function(){
		this.catStore = Ext.create('ES.store.upload.UploadStore');
		this.subCatStore = Ext.create('Ext.data.Store',{
			fields:['name']
		});
		this.items=[
			{
				xtype:'form',
				width:'100%',
				bodyPadding:30,
				layout:{
					type:'hbox',
					pack:'center',
					align:'center',
					defaultMargins:{top: 0, right: 20, bottom: 0, left: 0}
				},
				style:{
					backgroundColor:'white'
				},
				items:[
					{
					 	xtype: 'container',
					 	border:0,
					 	layout:{
					 		type:'vbox',
					 		align:'center'
					 	},
					 	defaults:{
					 		width:300			 		
					 	},
					 	bodyPadding:30,
		                items: [
		                    {
		                        xtype: 'combo',
		                        name : 'category',
		                        store:this.catStore,
		                        displayField:'name',
		                        valueField:'name',
		                        queryMode: 'local',
		                        fieldLabel: '*Category'
		                    },
		                    {
		                        xtype: 'combo',
		                        name : 'subCategory',
		                        store:this.subCatStore,
		                        displayField:'name',
		                        valueField:'name',
		                        queryMode: 'local',
		                        fieldLabel: '*Sub Category'
		                    },
		                     {
		                        xtype: 'textfield',
		                        name : 'title',
		                        fieldLabel: '*Title'
		                    },
		                    {
		                        xtype: 'textfield',
		                        name : 'keywords',
		                        fieldLabel: '*Search Keywords'
		                    },
		                     {
		                        xtype: 'textarea',
		                        name : 'desc',
		                        height:110,
		                        fieldLabel: '*Description'
		                    }
		                ]
					},
					{
					 	xtype: 'container',
					 	border:0,
					 	layout:{
					 		type:'vbox',
					 		align:'center'
					 	},
					 	defaults:{
					 		width:300			 		
					 	},
					 	bodyPadding:30,
		                items: [
		                    {
		                        xtype: 'filefield',
		                        name : 'screenshot',
		                        fieldLabel: '*Screen shot',
		                        buttonText:'Browse...'
		                    },
		                    {
		                        xtype: 'filefield',
		                        name : 'component',
		                        fieldLabel: '*Component',
		                        buttonText:'Browse...'
		                    },
		                    {
		                        xtype: 'filefield',
		                        name : 'manual',
		                        fieldLabel: '*Manual',
		                        buttonText:'Browse...'
		                    },
		                    {
		                        xtype: 'multiselectfield',
		                        name : 'environment',
		                        fieldLabel: '*Environment',
		                        height:70,
		                        store: [['ie7','IE 7'],
					                    ['ie8', 'IE 8'], ['ie9', 'IE 9'], ['moz', 'Mozilla Firefox'], ['chrome', 'Google Chrome'], ['safari', 'Apple Safari'],
					                    ['opera', 'Opera'],['na', 'N/A']]
		                    },
		                    {
		                        xtype: 'multiselectfield',
		                        name : 'language',
		                        height:70,
		                        fieldLabel: '*Language',
		                         store: [['html4','HTML 4.0'],
					                    ['html5','HTML 5.0'], ['css2', 'CSS 2.0'], ['css3', 'CSS 3.0'], ['na', 'N/A']]
		                    }
		                ]
					}		
				]
			}
		]
		this.buttons=[
			{
				text:'upload',
				action:'save'
			},
			{
                text: 'Cancel',
                scope: this,
                handler: this.close
            }
		]
		this.callParent(arguments);
	}
});